package com.mirei.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;


/**
 * @author dlx延迟队列
 */
@Slf4j
@Component
public class DlxListener {
    @RabbitListener(bindings = @QueueBinding(
            value = @Queue(name = "boot.delay",durable = "true"),
            exchange = @Exchange(name = "boot.delay",delayed = "true"),
            key = "boot.delay"))
    public void listenDelayMsg(Message message){
        log.info("收到delay.queue的延迟消息:{}",message);
    }
}